package liquor.core;

public class ThreadLocalConstants {
	private static ThreadLocal<StringBuffer> threadLocalStringBuffer = null;
	
	public static StringBuffer getThreadLocalStringBuffer() {
		StringBuffer ret = null;
		
		if (threadLocalStringBuffer == null) {
			threadLocalStringBuffer = new ThreadLocal<StringBuffer>();
			
			StringBuffer sb = new StringBuffer();
			threadLocalStringBuffer.set(sb);
		}
		
		ret = threadLocalStringBuffer.get();
		
		if (ret == null) {
			StringBuffer sb = new StringBuffer();
			threadLocalStringBuffer.set(sb);
			
			ret = sb;
		}
		
		ret.setLength(0);
		
		return ret;
	}
}
